import {
	IListAbility,
	IListExpBarAbility,
	IListExpBarController,
	IListExpBarControllerParams,
	IListExpBarStore,
	ListExpBarActionType,
} from '@/core/interface';
import { ExpCtrlController } from './exp-ctrl-controller';

/**
 * 列表导航栏控制器
 *
 * @export
 * @class ListExpBarController
 * @extends {ExpCtrlController<ListExpBarActionType, IListExpBarStore, IListExpBarAbility>}
 * @implements {IListExpBarController<IListExpBarStore, IListExpBarAbility>}
 */
export class ListExpBarController
	extends ExpCtrlController<
		ListExpBarActionType,
		IListExpBarStore,
		IListExpBarAbility
	>
	implements IListExpBarController<IListExpBarStore, IListExpBarAbility>
{
	/**
	 * Creates an instance of ListExpBarController.
	 * @param {IListExpBarControllerParams<ListExpBarActionType, IListExpBarAbility>} params
	 * @memberof ListExpBarController
	 */
	public constructor(
		params: IListExpBarControllerParams<
			ListExpBarActionType,
			IListExpBarAbility
		>
	) {
		super(params);
		this.ctrlInit(params);
	}

	/**
	 * 处理部件初始化
	 *
	 * @protected
	 * @param {IListExpBarControllerParams<ListExpBarActionType, IListExpBarAbility>} params
	 * @memberof ListExpBarController
	 */
	protected processCtrlInit(
		params: IListExpBarControllerParams<
			ListExpBarActionType,
			IListExpBarAbility
		>
	) {
		super.processCtrlInit(params);
		Object.assign(this.store, { selection: {} });
	}
}
